package com.harlov.robanuka.support;

import org.anddev.andengine.engine.Engine;
import org.anddev.andengine.opengl.texture.Texture;
import org.anddev.andengine.opengl.texture.TextureOptions;
import org.anddev.andengine.opengl.texture.region.TextureRegion;
import org.anddev.andengine.opengl.texture.region.TextureRegionFactory;
import org.anddev.andengine.opengl.texture.region.TiledTextureRegion;
import org.anddev.andengine.opengl.texture.source.AssetTextureSource;
import org.anddev.andengine.opengl.texture.source.ITextureSource;
import org.anddev.andengine.ui.activity.BaseGameActivity;
import org.anddev.andengine.entity.scene.background.RepeatingSpriteBackground;

public class resources {
	
	private Texture mTexture,mOnScreenControlTexture,mGunsTexture;
	
	private TextureRegion back_img;
	TiledTextureRegion r_player;
	
	private TextureRegion mOnScreenControlBaseTextureRegion;
    private TextureRegion mOnScreenControlKnobTextureRegion;
    
    private TiledTextureRegion mLaserRegion;
    
	
	public resources(final BaseGameActivity activity, final Engine engine) 
	 {
		//фон и игрок
		this.mTexture = new Texture(1024,1024,TextureOptions.BILINEAR_PREMULTIPLYALPHA); 
		
		
		this.back_img = TextureRegionFactory.createFromAsset(this.mTexture, activity,"gfx/back.jpg",0,0);
		this.r_player = TextureRegionFactory.createTiledFromAsset(this.mTexture, activity, "gfx/banana_tiled.png",568,0,4,2);
		
		
		//текстуры управления
		this.mOnScreenControlTexture = new Texture(256, 128, TextureOptions.BILINEAR_PREMULTIPLYALPHA); 
		this.mOnScreenControlBaseTextureRegion = TextureRegionFactory.createFromAsset(this.mOnScreenControlTexture, activity, "gfx/jost_fon.png", 0, 0);
		this.mOnScreenControlKnobTextureRegion = TextureRegionFactory.createFromAsset(this.mOnScreenControlTexture, activity, "gfx/jost_but.png", 128, 0);
		
		//Оружие
		
		
		this.mGunsTexture = new Texture (32,8,TextureOptions.BILINEAR_PREMULTIPLYALPHA);
		this.mLaserRegion = TextureRegionFactory.createTiledFromAsset(this.mGunsTexture,activity, "gfx/weapon/laser.png",0,0,2,2);
		
		engine.getTextureManager().loadTexture(this.mTexture);
		engine.getTextureManager().loadTexture(this.mOnScreenControlTexture);
		engine.getTextureManager().loadTexture(this.mGunsTexture);
		
		
		
		
		
		
		
	}
	
	public TextureRegion getBack() {
		return back_img;
	}
	
	public TiledTextureRegion getPlayer() {
		return r_player;
	}
	
	public TextureRegion getJostfon()
	{
		return this.mOnScreenControlBaseTextureRegion;
	}
	
	public TextureRegion getJostbut()
	{
		return this.mOnScreenControlKnobTextureRegion;
	}
	
	public TiledTextureRegion getLaserShot()
	{
		return mLaserRegion;
	}

}
